Grokking JavaScript Fundamentals
Rate this course
Ask Author
Contribute
Back to course home

0% completed

Vote For New Content
Introduction
Who should take this course?
Course Overview
Introduction to JavaScript
JavaScript Basics
JavaScript - Hello World
JavaScript - Comments
Quiz
JavaScript - Variables
JavaScript - Operators
Quiz
Introduction to Conditional Statements in JavaScript
JavaScript - If...Else
JavaScript - Switch Case
Quiz
Introduction to Objects in JavaScript
JavaScript - Number
JavaScript - Boolean
JavaScript - Math
JavaScript - Date
Quiz
Introductions to Function in JavaScript
JavaScript - Variable Scope
JavaScript - Default Parameters
JavaScript - Arrow Functions
Quiz
Introduction to Strings in JavaScript
JavaScript - String Methods
Introduction to Array in JavaScript
JavaScript - Array Methods
Quiz
Introduction to loops in JavaScript
JavaScript - for loop
JavaScript - while loop
JavaScript - do-while loop
JavaScript - for-in loop
JavaScript - for-of loop
JavaScript - Loop Control
Quiz
JavaScript - Maps
JavaScript - Sets
Quiz
Where to Go from Here
JavaScript - Hello World

One of the first steps in learning a new programming language is to create a simple program. In many programming tutorials, this is traditionally a "Hello, World!" program, which simply prints a message to the screen. Each programming language has its own unique syntax to accomplish this task. In JavaScript, you can do this using the console.log() method.

Here’s how you can print the message "Hello, World!" to the console in JavaScript:

Javascript

. . . .

Go ahead and hit Execute button to run your first program. You should see the message "Hello, World!" appear in the stdout section located below your code editor.

Explanation

  • console.log(): This JavaScript method logs any message to the console.
  • "Hello, World!": This is the string we want to print. In JavaScript, strings can be enclosed in either single (') or double (") quotes.

This simple exercise demonstrates the basic structure of a JavaScript statement and introduces the concept of printing data to the console, a crucial technique for debugging and for displaying data during development.

Try it Yourself: Modify the code to print "Hello, Design Gurus!" instead. Hit Execute button to see the new output.

Congratulations! You have just written your first JavaScript program. Keep experimenting with different messages to see how the output changes.

Introduction to JavaScript
JavaScript - Comments
Mark as Completed

On this page

Explanation